import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../views/Layout/index.vue'
import Login from '../views/Login/index.vue'
import Home from '../views/Layout/Home/index.vue'
import Goods from '../views/Layout/Goods/index.vue'
import News from '../views/Layout/News/index.vue'
import About from '../views/layout/About/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: Layout,
      children: [
        {
          path:'',
          component: Home,
        },
        {
          path: 'goods',
          component: Goods,
        },
        {
          path: 'news',
          component: News,
        },
        {
          path: 'about',
          component: About,
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    }
  ]
})

export default router
